package top.chenfu.auto;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Import;
import top.chenfu.auto.config.MyConfigImportSelector;

/**
 * @Auther chenfu
 * @2019/12/14 22:16
 * @Desc
 */
@SpringBootApplication
//自定义的注解或者直接使用Import也可以
//@EnableMyConfig
@Import(value = MyConfigImportSelector.class)
public class AutoConfigApp {

    public static void main(String[] args) {
        ConfigurableApplicationContext app = SpringApplication.run(AutoConfigApp.class, args);
        Object chenfu = app.getBean("chenfu");
        System.out.println(chenfu);
    }

}
